package com.guxingke.gsb.model;

import java.util.List;

/**
 * Created by 孤星可 on 2015/12/2.
 *
 * @author guxingke
 * @since 2015/12/2
 */
public class IndexModel {
    private String previousPage;
    private String nextPage;
    private List<Post> posts;

    public IndexModel(List<Post> posts, int page, boolean hasMore) {
        if (page == 1) {
            this.previousPage = "#";
        }else if (page == 2){
            this.previousPage = "/";
        } else {
            this.previousPage = "/" + (page - 1);
        }

        if (hasMore) {
            this.nextPage = "/" + (page + 1);
        } else {
            this.nextPage = "#";
        }

        this.posts = posts;
    }

    public String getPreviousPage() {
        return previousPage;
    }

    public void setPreviousPage(String previousPage) {
        this.previousPage = previousPage;
    }

    public String getNextPage() {
        return nextPage;
    }

    public void setNextPage(String nextPage) {
        this.nextPage = nextPage;
    }

    public List<Post> getPosts() {
        return posts;
    }

    public void setPosts(List<Post> posts) {
        this.posts = posts;
    }
}
